使用 postbuild 事件设置 运行 后应用程序未启动

Application does not start after running setup with postbuild event

我使用了这个线程中的脚本:Run exe after msi installation? respectively this site: Mailbag: How can I customize an MSI in the Visual Studio setup/deployment project?

已完成对话框中的复选框出现,但我的应用程序在按下完成后没有启动。没有任何反应。

我试过不同的线路:

sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch', '210', '" + fileId + "', '')";

sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch', '226', 'TARGETDIR', 'MyProgram.exe')";

有什么想法,或者是否可以调试脚本或编写包含更多信息的日志以找出到底是什么不起作用?该应用程序需要管理员权限。这重要吗?

Formatted: The fact that notepad.exe works probably means that you need a full path (notepad.exe is in the system path and can hence be invoked without a path, other binaries need full path).

Did you try to do [#filekey] as in [#MyProgram.exe] as value in the Target field? The reference must match a File table entry. So look in the first column of the File table to determine what the file identifier is, and use that in the Target field.

Check out the documentation for Formatted.

WiX?: By the way, is it an option to migrate to WiX? Not to annoy you, but there are some major problems with Visual Studio Projects for long term use. Maybe give it a quick skim.

文件Table:

快捷方式Table:


下面留下原答案:


快速测试:也许首先检查一下:What VSDCA_Launch mean in Custom Action script


Logging:您是否启用了日志记录以确定发生了什么?请快速查看 the Logging section in this answer "how to"。

干燥运行:我想你可以滑流notepad.exe 在那里而不是您自己的可执行文件,以查看它是否在不需要管理员权限时启动正常。您只需要一个测试版本和一个测试 运行.

不完整:我打赌你在 post 处理 MSI 时忘记了一些东西。我的猜测是一个简单的格式问题,例如上面链接的 post 所描述的。